package core.dao.mybatis;

import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Repository;

import core.dao.DbSequenceDao;

@Repository("dbSequenceDao")
public class OracleSequenceDao extends SqlSessionDaoSupport implements DbSequenceDao {

	public Long nextValue(String sequenceId) {
		Object seq = super.getSqlSessionTemplate().selectOne("select " + sequenceId + ".nextval from dual");
		return (Long)seq;
	}

}
